﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;

namespace Teigha.Core
{
	public class OdGeInterval : IDisposable
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdGeInterval(IntPtr cPtr, bool cMemoryOwn)
		{
			this.swigCMemOwn = cMemoryOwn;
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdGeInterval obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdGeInterval()
		{
			this.Dispose();
		}

		public virtual void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							GlobalsPINVOKE.delete_OdGeInterval(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
		}

		public OdGeInterval(double tol) : this(GlobalsPINVOKE.new_OdGeInterval__SWIG_0(tol), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeInterval() : this(GlobalsPINVOKE.new_OdGeInterval__SWIG_1(), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeInterval(OdGeInterval interval) : this(GlobalsPINVOKE.new_OdGeInterval__SWIG_2(OdGeInterval.getCPtr(interval)), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeInterval(double lower, double upper, double tol) : this(GlobalsPINVOKE.new_OdGeInterval__SWIG_3(lower, upper, tol), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeInterval(double lower, double upper) : this(GlobalsPINVOKE.new_OdGeInterval__SWIG_4(lower, upper), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeInterval(bool boundedBelow, double bound, double tol) : this(GlobalsPINVOKE.new_OdGeInterval__SWIG_5(boundedBelow, bound, tol), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeInterval(bool boundedBelow, double bound) : this(GlobalsPINVOKE.new_OdGeInterval__SWIG_6(boundedBelow, bound), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeInterval Assign(OdGeInterval interval)
		{
			OdGeInterval result = new OdGeInterval(GlobalsPINVOKE.OdGeInterval_Assign(this.swigCPtr, OdGeInterval.getCPtr(interval)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public double lowerBound()
		{
			double result = GlobalsPINVOKE.OdGeInterval_lowerBound(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public double upperBound()
		{
			double result = GlobalsPINVOKE.OdGeInterval_upperBound(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public double element()
		{
			double result = GlobalsPINVOKE.OdGeInterval_element(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void getBounds(out double lower, out double upper)
		{
			GlobalsPINVOKE.OdGeInterval_getBounds(this.swigCPtr, out lower, out upper);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public double length()
		{
			double result = GlobalsPINVOKE.OdGeInterval_length(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public double tolerance()
		{
			double result = GlobalsPINVOKE.OdGeInterval_tolerance(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeInterval set(double lower, double upper)
		{
			OdGeInterval result = new OdGeInterval(GlobalsPINVOKE.OdGeInterval_set__SWIG_0(this.swigCPtr, lower, upper), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeInterval set(bool boundedBelow, double bound)
		{
			OdGeInterval result = new OdGeInterval(GlobalsPINVOKE.OdGeInterval_set__SWIG_1(this.swigCPtr, boundedBelow, bound), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeInterval set()
		{
			OdGeInterval result = new OdGeInterval(GlobalsPINVOKE.OdGeInterval_set__SWIG_2(this.swigCPtr), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeInterval setUpper(double upper)
		{
			OdGeInterval result = new OdGeInterval(GlobalsPINVOKE.OdGeInterval_setUpper(this.swigCPtr, upper), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeInterval setLower(double lower)
		{
			OdGeInterval result = new OdGeInterval(GlobalsPINVOKE.OdGeInterval_setLower(this.swigCPtr, lower), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeInterval setTolerance(double tol)
		{
			OdGeInterval result = new OdGeInterval(GlobalsPINVOKE.OdGeInterval_setTolerance(this.swigCPtr, tol), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void getMerge(OdGeInterval otherInterval, OdGeInterval result)
		{
			GlobalsPINVOKE.OdGeInterval_getMerge(this.swigCPtr, OdGeInterval.getCPtr(otherInterval), OdGeInterval.getCPtr(result));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public int subtract(OdGeInterval otherInterval, OdGeInterval lInterval, OdGeInterval rInterval)
		{
			int result = GlobalsPINVOKE.OdGeInterval_subtract(this.swigCPtr, OdGeInterval.getCPtr(otherInterval), OdGeInterval.getCPtr(lInterval), OdGeInterval.getCPtr(rInterval));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool intersectWith(OdGeInterval otherInterval, OdGeInterval result)
		{
			bool result2 = GlobalsPINVOKE.OdGeInterval_intersectWith(this.swigCPtr, OdGeInterval.getCPtr(otherInterval), OdGeInterval.getCPtr(result));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result2;
		}

		public bool isBounded()
		{
			bool result = GlobalsPINVOKE.OdGeInterval_isBounded(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isBoundedAbove()
		{
			bool result = GlobalsPINVOKE.OdGeInterval_isBoundedAbove(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isBoundedBelow()
		{
			bool result = GlobalsPINVOKE.OdGeInterval_isBoundedBelow(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isUnBounded()
		{
			bool result = GlobalsPINVOKE.OdGeInterval_isUnBounded(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isSingleton()
		{
			bool result = GlobalsPINVOKE.OdGeInterval_isSingleton(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isDisjoint(OdGeInterval otherInterval)
		{
			bool result = GlobalsPINVOKE.OdGeInterval_isDisjoint(this.swigCPtr, OdGeInterval.getCPtr(otherInterval));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool contains(OdGeInterval otherInterval)
		{
			bool result = GlobalsPINVOKE.OdGeInterval_contains__SWIG_0(this.swigCPtr, OdGeInterval.getCPtr(otherInterval));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool contains(double value)
		{
			bool result = GlobalsPINVOKE.OdGeInterval_contains__SWIG_1(this.swigCPtr, value);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isContinuousAtUpper(OdGeInterval otherInterval)
		{
			bool result = GlobalsPINVOKE.OdGeInterval_isContinuousAtUpper(this.swigCPtr, OdGeInterval.getCPtr(otherInterval));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isOverlapAtUpper(OdGeInterval otherInterval, OdGeInterval overlap)
		{
			bool result = GlobalsPINVOKE.OdGeInterval_isOverlapAtUpper(this.swigCPtr, OdGeInterval.getCPtr(otherInterval), OdGeInterval.getCPtr(overlap));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool IsEqual(OdGeInterval otherInterval)
		{
			bool result = GlobalsPINVOKE.OdGeInterval_IsEqual(this.swigCPtr, OdGeInterval.getCPtr(otherInterval));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool IsNotEqual(OdGeInterval otherInterval)
		{
			bool result = GlobalsPINVOKE.OdGeInterval_IsNotEqual(this.swigCPtr, OdGeInterval.getCPtr(otherInterval));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isEqualAtUpper(OdGeInterval otherInterval)
		{
			bool result = GlobalsPINVOKE.OdGeInterval_isEqualAtUpper__SWIG_0(this.swigCPtr, OdGeInterval.getCPtr(otherInterval));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isEqualAtUpper(double value)
		{
			bool result = GlobalsPINVOKE.OdGeInterval_isEqualAtUpper__SWIG_1(this.swigCPtr, value);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isEqualAtLower(OdGeInterval otherInterval)
		{
			bool result = GlobalsPINVOKE.OdGeInterval_isEqualAtLower__SWIG_0(this.swigCPtr, OdGeInterval.getCPtr(otherInterval));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isEqualAtLower(double value)
		{
			bool result = GlobalsPINVOKE.OdGeInterval_isEqualAtLower__SWIG_1(this.swigCPtr, value);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isPeriodicallyOn(double period, out double value)
		{
			bool result = GlobalsPINVOKE.OdGeInterval_isPeriodicallyOn(this.swigCPtr, period, out value);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		private object locker = new object();

		private HandleRef swigCPtr;

		protected bool swigCMemOwn;
	}
}
